import http from '@/utils/http.js'

//预下单
export function preorder(type,data){
	return http({
		url:`/order/pre_order/${type}`,
		method:'POST',
		data
	})
}
//提交订单
export function suborder(type,data){
	return http({
		url:`/order/sub_order/${type}`,
		method:'POST',
		data
	})
}
//获取会员openid
export function getopenid(code){
	return http({
		url:`/get_openid/${code}`
	})
}
//立即支付
export function soonpay(id){
	return http({
		url:`/order/pay/${id}`,
		method:'PUT'
	})
}
//取消订单
export function ordercancel(id){
	return http({
		url:`/order/cancel/${id}`,
		method:'PUT'
	})
}
//申请退款
export function orderrefund(data){
	return http({
		url:'/order/refund',
		method:'POST',
		data
	})
}
//退款单详情
export function refund(id){
	return http({
		url:`/order/refund/${id}`
	})
}